package com.sanley.piss.model.po;

import com.sanley.piss.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author 张凯大天才
 */
@ToString
@EqualsAndHashCode
@Data
@ApiModel(value = "员工基本信息表", description = "员工基本信息表说明")
public class BasicInfo extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -3005873540914655540L;

    @ApiModelProperty(value = "关联用户表ID", hidden = true)
    private Integer userId;

    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "姓名不能为空")
    private String name;

    @ApiModelProperty(value = "性别,0女 1男")
    private Integer sex;

    @ApiModelProperty(value = "年龄")
    @NotNull(message = "年龄不能为空")
    @Range(min = 0, max = 100, message = "年龄输入不正确")
    private Integer age;

    @ApiModelProperty(value = "身高   cm")
    @NotNull(message = "身高不能为空")
    private BigDecimal height;

    @ApiModelProperty(value = "体重   kg")
    @NotNull(message = "体重不能为空")
    private BigDecimal weight;

    @ApiModelProperty(value = "血型 关联数据库字典")
    private Integer bloodType;

    @ApiModelProperty(value = "生日类型ID", hidden = true)
    private Integer birthdayType;

    @ApiModelProperty(value = "生日日期")
    @NotNull(message = "生日日期不能为空")
    private Date birthday;

    @ApiModelProperty(value = "喜好")
    @NotBlank(message = "喜好不能为空")
    private String hobby;

    @ApiModelProperty(value = "手机号码")
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "[1-9][0-9]{10,10}", message = "手机号码格式错误")
    private String phoneNumber;

    @ApiModelProperty(value = "微信")
    @NotBlank(message = "微信不能为空")
    private String wechat;

    @ApiModelProperty(value = "QQ")
    private String qq;

    @ApiModelProperty(value = "电子邮箱")
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", message = "电子邮箱格式错误")
    private String email;

    @ApiModelProperty(value = "服装型号")
    private String empCloModel;

    @ApiModelProperty(value = "鞋号")
    private BigDecimal empThose;

    @ApiModelProperty(value = "过敏药")
    private String empAllermedicine;

    @ApiModelProperty(value = "居住地址")
    @NotBlank(message = "住房地址不能为空")
    private String empHousaddr;

    @ApiModelProperty(value = "岗位ID,关联数据库字典",hidden = true)
    private Integer positionId;

    @ApiModelProperty(value = "职位ID,关联数据库字典")
    private Integer job;

    @ApiModelProperty(value = "工号")
    @NotBlank(message = "工号不能为空")
    @Size(max = 5, min = 2,message = "工号格式错误")
    private String jobNum;

    @ApiModelProperty(value = "工龄")
    private BigDecimal seniority;

    @ApiModelProperty(value = "加入公司日期")
    @NotNull(message = "加入公司日期不能为空")
    private Date dateJoinedcom;

    @ApiModelProperty(value = "在职情况，关联数据字典")
    private Integer workingConditions;

    @ApiModelProperty(value = "离职时间")
    private Date resignationTime;

    @ApiModelProperty(value = "合同类型 关联数据字典")
    private Integer contractType;
}